package com.hejielife.activeobject1;

/**
 * 2019年8月2日 下午5:14:45
 * 
 * @author hejielife
 * @despribe Servant
 */
class Servant implements ActiveObject {
	public Result makeString(int count, char fillchar) {
		char[] buffer = new char[count];
		for (int i = 0; i < count; i++) {
			buffer[i] = fillchar;
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
			}
		}
		return new RealResult(new String(buffer));
	}

	public void displayString(String string) {
		try {
			System.out.println("displayString: " + string);
			Thread.sleep(10);
		} catch (InterruptedException e) {
		}
	}
}
